<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./js/jquery-1.12.4.js"></script>
    <script>
        $(function(){
            // e 代表事件 event
            $(document).keydown(function(e){
                console.log(e.keyCode);
                if(e.keyCode == 81){
                    alert("你按了q键");
                }
            })
        })
    </script>
</body>
</html>